﻿using System;
using System.Reflection;

namespace _106_重命名无级的字段_元组
{
    class Program
    {
        static void Main(string[] args)
        {
            (double x, double y) d = (0.000025d, 3.114d);
            //将数组中的字段相乘，并输出计算结果
            Console.WriteLine("x*y={0}", d.x * d.y);

            //运行时类型
            Type zoomla = d.GetType();
            //获取字段列表
            var fds = zoomla.GetFields(BindingFlags.Public | BindingFlags.Instance);
            Console.WriteLine("元组的运行时类型：{0}", zoomla.Name);
            string infos = string.Empty;
            foreach (var f in fds)
            {
                infos += $"{f.Name}:{f.FieldType.Name}\n";
            }
            Console.WriteLine("各字段名称与类型：\n{0}", infos);
        }
    }
}
